<#setting number_format="###############">
<#setting url_escaping_charset="UTF-8">
<#macro paging totalcntStr curpageStr perpage showpages keyword>
	<#assign totalcnt = totalcntStr?number >
	<#if totalcnt ==0>
		<#return>
	</#if>
	<#if totalcnt  gt 2000>
		<#assign totalcnt = 2000>
	</#if>
	<#attempt>
		<#assign curpage = curpageStr?number >
	<#recover>
		<#assign curpage = 1>
	</#attempt>

	<#if (totalcnt/perpage)?int!=0 && (totalcnt%perpage == 0)>
		<#assign totalpage = (totalcnt/perpage)?int>
	<#else>
		<#assign totalpage = (totalcnt/perpage)?int+1 >
	</#if>
	<#if (curpage/showpages)?int!=0 && (curpage%showpages == 0)>
		<#assign startpage = ((curpage/showpages)?int-1)*showpages+1 >
	<#else>
		<#assign startpage = ((curpage/showpages)?int)*showpages+1 >
	</#if>
	<#if ((startpage+showpages) <= totalpage) >
		<#assign endpage = (startpage+showpages-1) >
	<#else>
		<#assign endpage = totalpage >
	</#if>
	<#if (endpage<startpage)>
		<#assign startpage=((endpage/showpages)?int)*showpages+1>
	</#if>
	<#if (endpage<=curpage)>
		<#assign curpage=endpage>
	</#if>	
	<#if 5<curpage && 10<totalpage>
		<#if curpage<=totalpage-4>
		 	<#assign startpage = curpage?number-5 >				
			<#assign endpage = curpage?number+4 >
			<#assign pre_startpage = startpage >				
			<#assign pre_endpage = endpage >
		<#else>
			<#assign startpage = totalpage-9 >				
			<#assign endpage = totalpage >
		</#if>		
	</#if>
	<#if curpage = 1>						
		首页 前一页
	</#if>
	<#if curpage gt 2 || curpage = 2>						
		<a onclick="javascript:submitForm('${keyword}','first','1');return false;" href="search.html?pagerMethod=first&keyword=${keyword}">首页</a> 
		<a onclick="javascript:submitForm('${keyword}','previous','${curpageStr}');return false;" href="search.html?pagerMethod=previous&currentPage=${curpageStr}&keyword=${keyword}">前一页</a> 
	</#if>			
	<#list startpage..endpage as i>				
		<#if i == curpage >
			<strong>${i}</strong>
			<#else><a onclick="javascript:submitForm('${keyword}','','${i}');return false;" href="search.html?currentPage=${i}&keyword=${keyword}">${i}</a>
		</#if>
	</#list>
	<#if curpage lt totalpage>
		<a onclick="javascript:submitForm('${keyword}','next','${curpageStr}');return false;" href="search.html?pagerMethod=next&currentPage=${curpageStr}&keyword=${keyword}">下一页</a> 
		<a onclick="javascript:submitForm('${keyword}','last','1');return false;" href="search.html?pagerMethod=last&keyword=${keyword}">尾页</a>
	</#if>
	<#if curpage = totalpage>
		下一页 尾页
	</#if>
</#macro>
<#macro pagingMulti totalcntStr curpageStr perpage showpages keyword>
	<#assign totalcnt = totalcntStr?number >
	<#if totalcnt ==0>
		<#return>
	</#if>
	<#if totalcnt  gt 2000>
		<#assign totalcnt = 2000>
	</#if>
	<#attempt>
		<#assign curpage = curpageStr?number >
	<#recover>
		<#assign curpage = 1>
	</#attempt>

	<#if (totalcnt/perpage)?int!=0 && (totalcnt%perpage == 0)>
		<#assign totalpage = (totalcnt/perpage)?int>
	<#else>
		<#assign totalpage = (totalcnt/perpage)?int+1 >
	</#if>
	<#if (curpage/showpages)?int!=0 && (curpage%showpages == 0)>
		<#assign startpage = ((curpage/showpages)?int-1)*showpages+1 >
	<#else>
		<#assign startpage = ((curpage/showpages)?int)*showpages+1 >
	</#if>
	<#if ((startpage+showpages) <= totalpage) >
		<#assign endpage = (startpage+showpages-1) >
	<#else>
		<#assign endpage = totalpage >
	</#if>
	<#if (endpage<startpage)>
		<#assign startpage=((endpage/showpages)?int)*showpages+1>
	</#if>
	<#if (endpage<=curpage)>
		<#assign curpage=endpage>
	</#if>	
	<#if 5<curpage && 10<totalpage>
		<#if curpage<=totalpage-4>
		 	<#assign startpage = curpage?number-5 >				
			<#assign endpage = curpage?number+4 >
			<#assign pre_startpage = startpage >				
			<#assign pre_endpage = endpage >
		<#else>
			<#assign startpage = totalpage-9 >				
			<#assign endpage = totalpage >
		</#if>		
	</#if>
	<#if curpage = 1>						
		首页 前一页
	</#if>
	<#if curpage gt 2 || curpage = 2>						
		<a onclick="javascript:submitForm('${keyword}','first','1');return false;" href="search.html?pagerMethod=first&keyword=${keyword}">首页</a> 
		<a onclick="javascript:submitForm('${keyword}','previous','${curpageStr}');return false;" href="search.html?pagerMethod=previous&currentPage=${curpageStr}&keyword=${keyword}">前一页</a> 
	</#if>			
	<#list startpage..endpage as i>				
		<#if i == curpage >
			<strong>${i}</strong>
			<#else><a onclick="javascript:submitForm('${keyword}','','${i}');return false;" href="search.html?currentPage=${i}&keyword=${keyword}">${i}</a>
		</#if>
	</#list>
	<#if curpage lt totalpage>
		<a onclick="javascript:submitForm('${keyword}','next','${curpageStr}');return false;" href="search.html?pagerMethod=next&currentPage=${curpageStr}&keyword=${keyword}">下一页</a> 
		<a onclick="javascript:submitForm('${keyword}','last','1');return false;" href="search.html?pagerMethod=last&keyword=${keyword}">尾页</a>
	</#if>
	<#if curpage = totalpage>
		下一页 尾页
	</#if>
</#macro>

<#macro webURL>
	http://127.0.0.1:8080/market/html/
</#macro>